<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="js/jquery-1.6.min.js"></script>
     <link rel="stylesheet" href="style.css" type="text/css" />


        <script>
            $(document).ready(function(){
                $("#con").live("submit",function(event){
                    
            event.preventDefault(); 
            
            login=$("#log").attr("value");
                    pass=$("#pass").attr("value");
                
                    $.post("loginadmin.php",{ log :login,password :pass},
                    function(data) {
                        if(data=="admin")            
                    
                        {                  
                            window.location = 'adminactions.php';

                        }
                        else if (data=="manager")
                        {
                       window.location ="index_manager.php";
  
                        }
						 else if (data=="client")
                        {
                       window.location = 'index client.php?id='+$("#log").attr("value")+'&log='+$("#pass").attr("value");
  
                        }
						else {
							document.getElementById("erreur").innerHTML=data;
						}
                    
                    });
                });
            });
        
        </script>

    </head>
    <body>
<div id="container">
			<form  id="con" >
				<div class="login">LOGIN</div>
				<div class="username-text">Username:</div>
				<div class="password-text">Password:</div>
				<div class="username-field">
					<input input id="log" type="text" maxlength="15" required/>
				</div>
				<div class="password-field">
					<input id="pass" type="password" required/>
				</div>
				<input type="checkbox" name="remember-me" id="remember-me" /><label for="remember-me">Remember me</label>
				<div class="forgot-usr-pwd">Forgot <a href="#">username</a> or <a href="#">password</a>?</div>
				<input type="submit" name="submit" value="GO" />
			</form>
		</div>
        <div id="erreur"></div>
  
</body>
        
    
</html>

<?php
//        session_start();
//
//        $_SESSION['c'] = "deconnect";
//
//        if ($_SESSION['admin'] == "deconnect") {
//
//            // session_destroy();
//        }
//        if ($_SESSION['admin'] == "connected") {
//            echo "connected";
//        }
        ?>

